package com.hyk.learning.registry;

import com.hyk.learning.common.extension.SPI;
import com.hyk.learning.dto.RpcRequest;

import java.net.InetSocketAddress;

/**
 * @className: ServiceDiscovery
 * @author: hyk199710
 * @description: service discovery
 * @date: 2024/4/29 22:51
 */
@SPI
public interface ServiceDiscovery {
    /**
     * @param rpcRequest: 完整的服务名称（class name+group+version）
     * @return InetSocketAddress 远程服务地址
     * @author 10091
     * @description lookup service by rpcServiceName
     * @date 2024/4/29 22:52
     */
    InetSocketAddress lookupService(RpcRequest rpcRequest);

    boolean checkRetry(String serviceName);
}
